﻿using Vroom;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Vroom.Common.Config;
using System.Diagnostics;
using System.Data.SqlClient;
using System.Data;
using Moq;
using Vroom.Common.Enums;

namespace Vroom.Test
{

    [TestClass()]
    public class LoaderBootstrapTest
    {
        //[TestMethod()] - Commented as kills local PC
        public void MainTest()
        {
            Stopwatch stopwatch = new Stopwatch();
            try
            {
                Mock<LoaderBootstrap> loaderBootstrapMock = new Mock<LoaderBootstrap>();
                loaderBootstrapMock.Object.Start();
            }
            catch (Exception)
            {
                Assert.Fail("Failed as error occured...");
            }
        }


        [TestMethod()]
        public void ParseArgsNoArgsTest()
        {
            Stopwatch stopwatch = new Stopwatch();
            try
            {
                Mock<LoaderBootstrap> loaderBootstrapMock = new Mock<LoaderBootstrap>();
                loaderBootstrapMock.Object.SourceSystem = SourceSystem.UNDEFINED;
                loaderBootstrapMock.Object.Start();

                Assert.IsTrue(loaderBootstrapMock.Object.ExceptionContext.Exceptions.Count > 0, "Should fail on fetching ConfigItems");
            }
            catch (Exception)
            {
                Assert.Fail("Failed as error occured...");
            }
        }
    }
}
